import launch
import launch_ros

def generate_launch_description():
    
    action_node_publisher_node = launch_ros.actions.Node(
        package='topic_pkg',
        executable="publisher_node",
        output='log',
        name='publisher_node',
    )
    action_node_subscriber_node = launch_ros.actions.Node(
        package='topic_pkg',
        executable='subscriber_node',
        output='both',
        name='subscriber_node',
    )
    # 合成启动描述并返回
    launch_description = launch.LaunchDescription([
        action_node_publisher_node,
        action_node_subscriber_node
    ])
    # 写法二
    # launch_description = launch.LaunchDescription()
    # launch_description.add_action(action_declare_arg_max_spped)
    # launch_description.add_action(action_node_turtle_control)
    # launch_description.add_action(action_node_patrol_client)
    # launch_description.add_action(action_node_turtlesim_node)
    return launch_description
